//后台设置
package lwsoft

//BindWindow 绑定指定的窗口,并指定这个窗口的屏幕颜色获取方式,鼠标仿真模式,键盘仿真模式,以及模式设定，注意：在没用使用此函数绑定窗口之前，对象的所有键盘鼠标命令都无效。
func (com *LwSoft) BindWindow(hwnd, display, mouse, keypad, added, mode int) int {
	ret, _ := com.lw.CallMethod("BindWindow", hwnd, display, mouse, keypad, added, mode)
	return int(ret.Val)
}

//UnBindWindow 解除绑定窗口,并释放系统资源.一般在OnScriptExit调用
func (com *LwSoft) UnBindWindow() int {
	ret, _ := com.lw.CallMethod("UnBindWindow")
	return int(ret.Val)
}

//ForceUnBindWindow 强制解除绑定窗口,并释放系统资源.
func (com *LwSoft) ForceUnBindWindow(hwnd int) int {
	ret, _ := com.lw.CallMethod("ForceUnBindWindow", hwnd)
	return int(ret.Val)
}

//SetDisplayInput 设定图色的获取方式，默认是显示器或者后台窗口(具体参考BindWindow)
func (com *LwSoft) SetDisplayInput(mode string) int {
	ret, _ := com.lw.CallMethod("SetDisplayInput", mode)
	return int(ret.Val)
}

//GetBindWindow 获取当前对象已经绑定的窗口句柄. 无绑定返回0
func (com *LwSoft) GetBindWindow() int {
	ret, _ := com.lw.CallMethod("GetBindWindow")
	return int(ret.Val)
}

//SwitchBindWindow 在不解绑的情况下,切换绑定窗口.(必须是同进程窗口)
func (com *LwSoft) SwitchBindWindow(hwnd int) int {
	ret, _ := com.lw.CallMethod("SwitchBindWindow", hwnd)
	return int(ret.Val)
}

//LockInput 禁止外部输入到绑定窗口
func (com *LwSoft) LockInput(lock int) int {
	ret, _ := com.lw.CallMethod("LockInput", lock)
	return int(ret.Val)
}

//IsBind 判定指定窗口是否已经被后台绑定. (前台无法判定)
func (com *LwSoft) IsBind(hwnd int) int {
	ret, _ := com.lw.CallMethod("IsBind", hwnd)
	return int(ret.Val)
}
